package com.lc.cehui.ui.adapter;

import android.graphics.Color;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.lc.cehui.R;
import com.lc.cehui.http.response.CompanyTypeBean;

import java.util.List;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

public class ChoiceAdapter extends BaseQuickAdapter<CompanyTypeBean.DataBean.List2Bean, BaseViewHolder> {
    public ChoiceAdapter(int layoutResId, @Nullable List<CompanyTypeBean.DataBean.List2Bean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, CompanyTypeBean.DataBean.List2Bean choiceBean) {
        baseViewHolder.setText(R.id.tv_item,choiceBean.getTitle());
        if (choiceBean.isSelect()){
            baseViewHolder.setBackgroundResource(R.id.tv_item,R.drawable.shape_jx_yj_blue);
            baseViewHolder.setTextColor(R.id.tv_item, Color.WHITE);
        } else {
            baseViewHolder.setBackgroundResource(R.id.tv_item,R.drawable.shape_jx_yj_ecec);
            baseViewHolder.setTextColor(R.id.tv_item, getContext().getResources().getColor(R.color.color999999));
        }
    }
}
